package com.isunland.managesystem.adapter;

import android.support.annotation.NonNull;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import butterknife.BindView;
import com.isunland.managesystem.R;
import com.isunland.managesystem.base.BaseButterKnifeAdapter;
import com.isunland.managesystem.base.BaseVolleyActivity;
import com.isunland.managesystem.entity.PayMoneyLog;
import com.isunland.managesystem.utils.MyStringUtil;
import java.util.ArrayList;

/**
 * 对象功能:
 * 开发公司: 北京信普达系统工程有限公司
 * 开发人员: wangyanan
 * 创建时间: 2017/4/21 15:07
 */

public class PayMoneyLogAdapter extends BaseButterKnifeAdapter<PayMoneyLog> {

  public PayMoneyLogAdapter(BaseVolleyActivity context, ArrayList<PayMoneyLog> objects) {
    super(context, objects);
  }

  @Override protected int setLayoutId() {
    return R.layout.adapter_pay_money_log;
  }

  @NonNull @Override protected BaseViewHolder initHolder(View convertView) {
    return new ViewHolder(convertView);
  }

  @Override protected void initView(PayMoneyLog item, BaseViewHolder baseHolder, int position) {
    ViewHolder holder = (ViewHolder) baseHolder;
    //holder.ivLogo.setImageResource(R.drawable.ic_pay);
    holder.tvTitle.setText(MyStringUtil.connect(context.getString(R.string.orderNo1),
        context.getString(R.string.colon), item.getBookOrderNo()));
    holder.tvContent.setText(
        MyStringUtil.connect(context.getString(R.string.payMuch), context.getString(R.string.colon),
            item.getPayMuch()));
    holder.tvContent2.setText(MyStringUtil.connect(context.getString(R.string.moneyType),
        context.getString(R.string.colon), item.getMoneyType()));
    holder.tvBottomLeft.setText(
        MyStringUtil.connect(item.getRegStaffName(), MyStringUtil.SEPEREATE, item.getRegDate()));
  }

  protected class ViewHolder extends BaseViewHolder {
    @BindView(R.id.iv_logo) ImageView ivLogo;
    @BindView(R.id.tv_title) TextView tvTitle;
    //@BindView(R.id.tv_titleRight) TextView tvTitleRight;
    @BindView(R.id.tv_content) TextView tvContent;
    @BindView(R.id.tv_content2) TextView tvContent2;
    //@BindView(R.id.tv_contentRight) TextView tvContentRight;
    //@BindView(R.id.tv_bottomRight) TextView tvBottomRight;
    @BindView(R.id.tv_bottomLeft) TextView tvBottomLeft;

    ViewHolder(View view) {
      super(view);
    }
  }
}
